import 'package:flutter/material.dart';
import 'package:movie_app_demo/constants.dart';
import 'package:movie_app_demo/models/movie.dart';
import 'package:movie_app_demo/screens/details/components/text_des.dart';
import 'backdrop_rating.dart';
import 'cast_and_crew.dart';
import 'genres.dart';
import 'title_duration_and_fab_btn.dart';

class Body extends StatelessWidget {
  final Movie movie;

  const Body({Key key, this.movie}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    //这里提供我们总到宽高
    Size size = MediaQuery.of(context).size;
    return CustomScrollView(
      physics: BouncingScrollPhysics(),
      slivers: <Widget>[
        BackdropAndRating(size: size, movie: movie), //背景图片和评分
        SliverToBoxAdapter(
          child: Column(
            children: <Widget>[
              SizedBox(height: kDefaultPadding / 2),
              TitleDurationAndFabBtn(movie: movie), //电影名称和日期
              Genres(movie: movie), //标签
              TextDes(movie: movie), //电影描述
              CastAndCrew(casts: movie.cast), //演员
            ],
          ),
        ),
      ],
    );
  }
}
